<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div class="box"></div>
    <script>
        let box = document.querySelector(".box")
        box.innerText = "zhangsan"
        //innerText  像节点内部添加文本
        console.log(box.innerText);  //能设置就能获取  需要等号赋值的写法   不加等号就相当于获取
        
        //innerHTML  
        box.innerHTML = "<h1 class='item'>123213</h1>"
    </script>
</body>

</html>